bitkeeper revision 1.784 (4050c414tIvxGfQ8IUNIXoAjpoXBVA)
authormwilli2@equilibrium.research.intel-research.net <mwilli2@equilibrium.research.intel-research.net>
Thu, 11 Mar 2004 19:55:00 +0000 (19:55 +0000)
committermwilli2@equilibrium.research.intel-research.net <mwilli2@equilibrium.research.intel-research.net>
Thu, 11 Mar 2004 19:55:00 +0000 (19:55 +0000)
Updated script names and added man pages for all the xentrace tools.

.rootkeys
docs/interface.tex
tools/xentrace/Makefile
tools/xentrace/xentrace.8 [new file with mode: 0644]
tools/xentrace/xentrace_cpusplit [new file with mode: 0644]
tools/xentrace/xentrace_cpusplit.1 [new file with mode: 0644]
tools/xentrace/xentrace_cpusplit.py [deleted file]
tools/xentrace/xentrace_format [new file with mode: 0644]
tools/xentrace/xentrace_format.1 [new file with mode: 0644]
tools/xentrace/xentrace_format.py [deleted file]

index 3458df6fc66286ef429e15d244cf6351480ee3f4..399015e8162c059ecd8ba94ce399d290e199222f 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 40431ac64Hj4ixUnKmlugZKhXPFE_Q tools/xend/Makefile
 40431ac8wrUEj-XM7B8smFtx_HA7lQ tools/xend/xend_utils.c
 403a3edbrr8RE34gkbR40zep98SXbg tools/xentrace/Makefile
+4050c413PhhLNAYk3TEwP37i_iLw9Q tools/xentrace/xentrace.8
 403a3edbVpV2E_wq1zeEkJ_n4Uu2eg tools/xentrace/xentrace.c
-403a3edb0lzD0Fojc-NYNoXr3SYrnA tools/xentrace/xentrace_cpusplit.py
-403a3edblCUrzSj0mmKhO5HOPrOrSQ tools/xentrace/xentrace_format.py
+403a3edb0lzD0Fojc-NYNoXr3SYrnA tools/xentrace/xentrace_cpusplit
+4050c413BnzzZZlZRI1ai6oFXOsHLQ tools/xentrace/xentrace_cpusplit.1
+403a3edblCUrzSj0mmKhO5HOPrOrSQ tools/xentrace/xentrace_format
+4050c413NtuyIq5lsYJV4P7KIjujXw tools/xentrace/xentrace_format.1
 3f72f1bdJPsV3JCnBqs9ddL9tr6D2g xen/COPYING
 3ddb79bcbOVHh38VJzc97-JEGD4dJQ xen/Makefile
 3ddb79bcWnTwYsQRWl_PaneJfa6p0w xen/Rules.mk
index 0a88f8c11322a95834e86bf9eb29e6e9b87959b0..297d430b99ceae2514dba3aa149b7106ba01db07 100644 (file)
@@ -432,10 +432,11 @@ for machines with multiple (logical) CPUs, the trace buffer output will not be
 in overall chronological order.
 
 The output from {\tt xentrace} can be post-processed using {\tt
-xentrace\_split.py} (used to split trace data out into per-cpu log files) and
-{\tt xentrace\_format.py} (used to pretty-print trace data).
+xentrace\_cpusplit} (used to split trace data out into per-cpu log files) and
+{\tt xentrace\_format} (used to pretty-print trace data).
 
-For more information, see the {\tt xentrace} manual page.
+For more information, see the manual pages for {\tt xentrace},
+{\tt xentrace_format} and {\tt xentrace_cpusplit}.
 
 
 \chapter{Hypervisor calls}
index 5758f6a2e7e074eaaecef9c352c874c3860637ef..2e85fcbe1ae6bdab217cc990afe90391dbff8e0d 100644 (file)
@@ -7,17 +7,18 @@ CFLAGS  += -I../../xenolinux-sparse/include
 HDRS     = $(wildcard *.h)
 OBJS     = $(patsubst %.c,%.o,$(wildcard *.c))
 
-BIN      = xentrace
-SCRIPTS  = $(wildcard *.py)
+BIN      = xentrace xentrace_cpusplit xentrace_format
+MAN1     = $(wildcard *.1)
+MAN8     = $(wildcard *.8)
 
 all: $(BIN)
 
 install: all
        mkdir -p /usr/bin
        cp $(BIN) /usr/bin
-       cp $(SCRIPTS) /usr/bin
-       chmod 755 /usr/bin/$(BIN)
-       for i in $(SCRIPTS); do chmod 755 /usr/bin/$$i; done
+       for i in $(BIN); do chmod 755 /usr/bin/$$i; done
+       for i in $(MAN1); do cp $$i /usr/man/man1/$$i; done
+       for i in $(MAN8); do cp $$i /usr/man/man8/$$i; done
 
 dist: all
        mkdir -p ../../../install/bin
diff --git a/tools/xentrace/xentrace.8 b/tools/xentrace/xentrace.8
new file mode 100644 (file)
index 0000000..b9720b9
--- /dev/null
@@ -0,0 +1,38 @@
+.TH XENTRACE 8 "11 March 2004" "Xen domain 0 utils"
+.SH NAME
+xentrace \- capture Xen trace buffer data
+.SH SYNOPSIS
+.B xentrace
+[
+.I OPTIONS
+] [
+.I FILE
+]
+.SH DESCRIPTION
+.B xentrace
+is used to dump data from Xen's per-cpu trace buffers.  Records
+are dumped in ASCII format, onto the standard output or a \fIFILE\fP
+specified on the command line.
+Trace records are formatted as follows:
+.PP
+                    CPU TSC EVENT D1 D2 D3 D4 D5
+.PP
+Where CPU is the processor number, TSC is the record's timestamp
+(the value of the CPU cycle counter), EVENT is the event ID and
+D1...D5 are the trace data.
+
+.SS Options
+.TP
+.B -t, --log-thresh=l
+set the threshold number, l, of new records required to trigger a write of
+all new records to the output
+.TP
+.B -s, --poll-sleep=p
+set the time, p, (in milliseconds) to sleep between polling the buffers
+for new data.
+
+.SH AUTHOR
+Mark A. Williamson <mark.a.williamson@intel.com>
+
+.SH "SEE ALSO"
+xentrace_cpuinfo(1), xentrace_format(1)
diff --git a/tools/xentrace/xentrace_cpusplit b/tools/xentrace/xentrace_cpusplit
new file mode 100644 (file)
index 0000000..9847b79
--- /dev/null
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+# by Mark Williamson, (C) 2004 Intel Research Cambridge
+
+# Program for separating trace buffer data into per-cpu log files.
+
+import re, sys, signal
+
+def usage():
+    print >> sys.stderr, \
+          "Usage: " + sys.argv[0] + """ base-name
+          Separates ASCII trace buffer data on stdin into per-CPU trace
+          files.  The trace files are named by appending the CPU number
+          to the base name supplied on the command line.
+
+          Depending on your system and the volume of trace buffer data,
+          this script may not be able to keep up with the output of xentrace
+          if it is piped directly.  In these circumstances you should have
+          xentrace output to a file for processing off-line.
+          """
+    sys.exit(1)
+    
+def sighand(x,y):
+    global interrupted
+    interrupted = 1
+
+signal.signal(signal.SIGTERM, sighand)
+signal.signal(signal.SIGHUP,  sighand)
+signal.signal(signal.SIGINT,  sighand)
+
+r = re.compile("(\d) .*")
+
+if len(sys.argv) < 2:
+    usage()
+else:
+    base_name = sys.argv[1]
+
+files = {}
+interrupted = 0
+
+while not interrupted:
+    try:
+        line = sys.stdin.readline()
+        if not line: break
+        
+        m = r.match(line)
+
+        if not m: print >> sys.stderr, "Invalid input line."
+        
+        cpu = m.group(1)
+        
+        if not files.has_key(base_name + str(cpu)):
+            files[base_name + str(cpu)] = open(base_name + str(cpu), "w")
+            
+        print >> files[base_name + str(cpu)], line,
+
+    except IOError: sys.exit()
+
+# files closed automatically
diff --git a/tools/xentrace/xentrace_cpusplit.1 b/tools/xentrace/xentrace_cpusplit.1
new file mode 100644 (file)
index 0000000..9b35ed5
--- /dev/null
@@ -0,0 +1,27 @@
+.TH XENTRACE_CPUSPLIT 1 "11 March 2004" "Xen domain 0 utils"
+.SH NAME
+xentrace_cpusplit \- separate Xen trace data into per-CPU log files
+.SH SYNOPSIS
+.B xentrace_cpusplit
+[
+.I BASE-NAME
+]
+.SH DESCRIPTION
+.B xentrace_cpusplit
+Separates ASCII trace buffer data from stdin into per-CPU trace
+files.  The trace files are named by appending the CPU number
+to the \fIBASE-NAME\fP supplied on the command line.
+
+The trace records in the per-CPU files are in identical format to the
+original output of \fBxentrace\fP and are in chronological order.
+
+Depending on your system and the rate at which trace data is produced,
+this script may not be able to keep up with the output of
+\fBxentrace\fP if it is piped directly.  In these circumstances you
+should have \fBxentrace\fP output to a file for processing off-line.
+
+.SH AUTHOR
+Mark A. Williamson <mark.a.williamson@intel.com>
+
+.SH "SEE ALSO"
+xentrace(8), xentrace_format(1)
diff --git a/tools/xentrace/xentrace_cpusplit.py b/tools/xentrace/xentrace_cpusplit.py
deleted file mode 100644 (file)
index 9847b79..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-
-# by Mark Williamson, (C) 2004 Intel Research Cambridge
-
-# Program for separating trace buffer data into per-cpu log files.
-
-import re, sys, signal
-
-def usage():
-    print >> sys.stderr, \
-          "Usage: " + sys.argv[0] + """ base-name
-          Separates ASCII trace buffer data on stdin into per-CPU trace
-          files.  The trace files are named by appending the CPU number
-          to the base name supplied on the command line.
-
-          Depending on your system and the volume of trace buffer data,
-          this script may not be able to keep up with the output of xentrace
-          if it is piped directly.  In these circumstances you should have
-          xentrace output to a file for processing off-line.
-          """
-    sys.exit(1)
-    
-def sighand(x,y):
-    global interrupted
-    interrupted = 1
-
-signal.signal(signal.SIGTERM, sighand)
-signal.signal(signal.SIGHUP,  sighand)
-signal.signal(signal.SIGINT,  sighand)
-
-r = re.compile("(\d) .*")
-
-if len(sys.argv) < 2:
-    usage()
-else:
-    base_name = sys.argv[1]
-
-files = {}
-interrupted = 0
-
-while not interrupted:
-    try:
-        line = sys.stdin.readline()
-        if not line: break
-        
-        m = r.match(line)
-
-        if not m: print >> sys.stderr, "Invalid input line."
-        
-        cpu = m.group(1)
-        
-        if not files.has_key(base_name + str(cpu)):
-            files[base_name + str(cpu)] = open(base_name + str(cpu), "w")
-            
-        print >> files[base_name + str(cpu)], line,
-
-    except IOError: sys.exit()
-
-# files closed automatically
diff --git a/tools/xentrace/xentrace_format b/tools/xentrace/xentrace_format
new file mode 100644 (file)
index 0000000..b8f8d01
--- /dev/null
@@ -0,0 +1,96 @@
+#!/usr/bin/env python
+
+# by Mark Williamson, (C) 2004 Intel Research Cambridge
+
+# Program for reformatting trace buffer output according to user-supplied rules
+
+import re, sys, string, signal
+
+def usage():
+    print >> sys.stderr, \
+          "Usage: " + sys.argv[0] + """ defs-file
+          Parses trace data in ASCII format and reformats it according to the
+          rules in a file of definitions.  The rules in this file should have
+          the format ({ and } show grouping and are not part of the syntax):
+
+          {event_id}{whitespace}{text format string}
+
+          The textual format string may include the format specifiers:
+            %(cpu)s, %(tsc), %(event)s, %(1)s, %(2)s, %(3)s, %(4)s, %(5)s
+
+          Which correspond to the CPU number, event ID, timestamp counter and
+          the 5 data fields from the trace record.  There should be one such
+          rule for each type of event.
+          
+          Depending on your system and the volume of trace buffer data,
+          this script may not be able to keep up with the output of xentrace
+          if it is piped directly.  In these circumstances you should have
+          xentrace output to a file for processing off-line.
+          """
+    sys.exit(1)
+
+def read_defs(defs_file):
+    defs = {}
+    
+    fd = open(defs_file)
+
+    reg = re.compile('(\d+)\s+(\S.*)')
+
+    while True:
+        line = fd.readline()
+        if not line:
+            break
+        
+        m = reg.match(line)
+
+        if not m: print >> sys.stderr, "Bad format file" ; sys.exit(1)
+        
+        defs[m.group(1)] = m.group(2)
+
+    return defs
+
+def sighand(x,y):
+    global interrupted
+    interrupted = 1
+
+##### Main code
+
+if len(sys.argv) < 2:
+    usage()
+
+signal.signal(signal.SIGTERM, sighand)
+signal.signal(signal.SIGHUP,  sighand)
+signal.signal(signal.SIGINT,  sighand)
+
+interrupted = 0
+
+defs = read_defs(sys.argv[1])
+
+reg = re.compile('(\d+) (\d+) (\d+) (.*)')
+
+while not interrupted:
+    try:
+        line = sys.stdin.readline()
+        if not line:
+            break
+
+        m = reg.match(line)
+
+        if not m: print >> sys.stderr, "Invalid input line."
+
+        s = string.split(m.group(4))
+
+        args = {'cpu'   : m.group(1),
+                'tsc'   : m.group(2),
+                'event' : m.group(3) }
+
+        i = 0
+        for item in s:
+            args[str(i)] = item
+            i += 1
+
+        if defs.has_key(m.group(3)): print defs[m.group(3)] % args
+        # silently skip lines we don't have a format for - a 'complain' option
+        # should be added if needed
+
+    except IOError: sys.exit()
diff --git a/tools/xentrace/xentrace_format.1 b/tools/xentrace/xentrace_format.1
new file mode 100644 (file)
index 0000000..ef08224
--- /dev/null
@@ -0,0 +1,38 @@
+.TH XENTRACE_FORMAT 1 "11 March 2004" "Xen domain 0 utils"
+.SH NAME
+xentrace_format \- pretty-print Xen trace data
+.SH SYNOPSIS
+.B xentrace_format
+[
+.I DEFS-FILE
+]
+.SH DESCRIPTION
+.B xentrace_format
+parses trace data from standard input and reformats it according to
+the rules in a file of definitions (\fIDEFS-FILE\fP), printing to
+standard output.
+
+The rules in \fIDEFS-FILE\fP should have the format shown below:
+
+\fIevent_id\fP \fIwhitespace\fP \fIformat\fP
+
+Each rule should start on a new line.
+
+The format string may include the following format specifiers:
+%(cpu)s, %(tsc), %(event)s, %(1)s, %(2)s, %(3)s, %(4)s, %(5)s
+
+These correspond to the CPU number, event ID, timestamp counter and
+the 5 data fields from the trace record.  There should be one such
+rule for each type of event to be pretty-printed (events which do not
+have formatting rules are ignored).
+          
+Depending on your system and the rate at which trace data is produced,
+this script may not be able to keep up with the output of
+\fBxentrace\fP if it is piped directly.  In these circumstances you
+should have \fBxentrace\fP output to a file for processing off-line.
+
+.SH AUTHOR
+Mark A. Williamson <mark.a.williamson@intel.com>
+
+.SH "SEE ALSO"
+xentrace(8), xentrace_cpusplit(1)
diff --git a/tools/xentrace/xentrace_format.py b/tools/xentrace/xentrace_format.py
deleted file mode 100644 (file)
index b8f8d01..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/env python
-
-# by Mark Williamson, (C) 2004 Intel Research Cambridge
-
-# Program for reformatting trace buffer output according to user-supplied rules
-
-import re, sys, string, signal
-
-def usage():
-    print >> sys.stderr, \
-          "Usage: " + sys.argv[0] + """ defs-file
-          Parses trace data in ASCII format and reformats it according to the
-          rules in a file of definitions.  The rules in this file should have
-          the format ({ and } show grouping and are not part of the syntax):
-
-          {event_id}{whitespace}{text format string}
-
-          The textual format string may include the format specifiers:
-            %(cpu)s, %(tsc), %(event)s, %(1)s, %(2)s, %(3)s, %(4)s, %(5)s
-
-          Which correspond to the CPU number, event ID, timestamp counter and
-          the 5 data fields from the trace record.  There should be one such
-          rule for each type of event.
-          
-          Depending on your system and the volume of trace buffer data,
-          this script may not be able to keep up with the output of xentrace
-          if it is piped directly.  In these circumstances you should have
-          xentrace output to a file for processing off-line.
-          """
-    sys.exit(1)
-
-def read_defs(defs_file):
-    defs = {}
-    
-    fd = open(defs_file)
-
-    reg = re.compile('(\d+)\s+(\S.*)')
-
-    while True:
-        line = fd.readline()
-        if not line:
-            break
-        
-        m = reg.match(line)
-
-        if not m: print >> sys.stderr, "Bad format file" ; sys.exit(1)
-        
-        defs[m.group(1)] = m.group(2)
-
-    return defs
-
-def sighand(x,y):
-    global interrupted
-    interrupted = 1
-
-##### Main code
-
-if len(sys.argv) < 2:
-    usage()
-
-signal.signal(signal.SIGTERM, sighand)
-signal.signal(signal.SIGHUP,  sighand)
-signal.signal(signal.SIGINT,  sighand)
-
-interrupted = 0
-
-defs = read_defs(sys.argv[1])
-
-reg = re.compile('(\d+) (\d+) (\d+) (.*)')
-
-while not interrupted:
-    try:
-        line = sys.stdin.readline()
-        if not line:
-            break
-
-        m = reg.match(line)
-
-        if not m: print >> sys.stderr, "Invalid input line."
-
-        s = string.split(m.group(4))
-
-        args = {'cpu'   : m.group(1),
-                'tsc'   : m.group(2),
-                'event' : m.group(3) }
-
-        i = 0
-        for item in s:
-            args[str(i)] = item
-            i += 1
-
-        if defs.has_key(m.group(3)): print defs[m.group(3)] % args
-        # silently skip lines we don't have a format for - a 'complain' option
-        # should be added if needed
-
-    except IOError: sys.exit()